package presenter;

import base.BasePresenter;
import base.ResultCallBack;
import bean.KechengBannerBean;
import model.KeChengModel;
import view.KeChengView;
import view.YingDaoView;

/**
 * Created by Windows on 2019/11/5.
 */

public class KeChengPresenter extends BasePresenter<KeChengView> implements ResultCallBack<KechengBannerBean> {
    private KeChengView keChengView;
    private KeChengModel keChengModel;

    public KeChengPresenter(KeChengView keChengView) {
        this.keChengView = keChengView;
        this.keChengModel = new KeChengModel();
    }

    public void getData() {
        keChengModel.getData(new ResultCallBack<KechengBannerBean>() {
            @Override
            public void onSuccess(KechengBannerBean kechengBannerBean) {
                keChengView.onKechengBannerSuccess(kechengBannerBean);
            }

            @Override
            public void onFail(String error) {

            }
        });
    }

    @Override
    public void onSuccess(KechengBannerBean kechengBannerBean) {
        keChengView.onKechengBannerSuccess(kechengBannerBean);
    }

    @Override
    public void onFail(String error) {
        keChengView.onKechengBannerFail(error);
    }
}
